package com.vic.gupao.rmi.service;

import java.net.MalformedURLException;
import java.rmi.AlreadyBoundException;
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;

public class Server {
    public static void main(String[] args) {
        try {
            IHelloService h = new IHelloServiceImp();

            LocateRegistry.createRegistry(1091);
            Naming.rebind("rmi://127.0.0.1/Hello",h);
            System.out.println("服务启动成功");


        } catch (RemoteException e) {
            e.printStackTrace();
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }


    }
}
